package cn.itcast.java.stream;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Author itcast
 * Date 2021/10/13 6:02
 * Desc TODO
 */
public class FileWriterDemo {
    public static void main(String[] args) throws IOException {
        FileReader reader = new FileReader("data/output/abc.txt");
        FileWriter writer = new FileWriter("data/output/cba.txt");
        char[] bts= new char[1024];
        int len;
        while((len=reader.read(bts))!=-1){
            writer.write(bts,0,len);
        }
        writer.flush();
    }
}
